﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace Enter.DataProxy.Configuration
{
    /// <summary>
    /// 链接字符串名称
    /// </summary>
    public class ConnectionNameElement : ConfigurationElement
    {
        /// <summary>
        /// 节点中属的名字（name）
        /// </summary>
        private static readonly string _NameProperty = "name";

        public ConnectionNameElement()
        { }

        public ConnectionNameElement(string name)
        {
            this[_NameProperty] = name;
        }

        /// <summary>
        /// 链接字符串名称，企业库使用的数据库链接将使用这个名称在配置文件节点[configuration/connectionStrings]中找到对应的链接字符串。
        /// </summary>
        [ConfigurationProperty("name", IsRequired = true, IsKey = true)]
        public string ConnectionName
        {
            get { return (string)this[_NameProperty]; }
            set { this[_NameProperty] = value; }
        }
    }
}
